A digital video stream is composed of a sequence of individual frames. Typically, the video stream has periodic keyframes. Each keyframe contains sufficient data to enable decoding and rendering of a complete image. In the MPEG standard, an intra-frame is an example of a keyframe. To reduce the amount of data transmitted or stored, the digital video stream also typically is includes non-keyframes that contain less information than is needed to decode and render a complete image. Non-keyframes are commonly inserted between keyframes and may contain, for example, information describing the motion of objects in the rendered images. In the MPEG standard, an inter-frame (e.g., P-frame or B-frame) is an example of a non-keyframe. A full image cannot be generated from a non-keyframe without first decoding a keyframe or multiple preceding non-keyframes in the video stream.
FIG. 1 illustrates a conventional compressed digital video stream 100 that includes a number of frames in sequence. Video stream 100 includes only non-keyframes (e.g., inter-frames). Video stream 100 has no keyframes (e.g., intra-frames). Video stream 100 is played by decoding the frames in their decode order and rendering the frames in their display order. To play a particular frame, a number of previous frames are first decoded to enable decoding and rendering of a completely specified image at the particular frame. The number of preceding frames used to decode the particular frame is determined by the video encoding format (e.g., MPEG 2, MPEG 4, H.26L, etc.) and the implementation of the encoder. For example, to decode and render non-keyframe 21 (referenced as frame 102 in FIG. 1) which resides in a digital video stream encoded using the MPEG 2 standard, a decoder may need to decode the preceding twenty non-keyframes 1-20 (are referenced generally as 104 in FIG. 1).
Playing back video streams with predominantly non-keyframes thus poses a problem in that a large number of preceding frames must first be decoded before presentation of the desired frame. This results in an inconvenient time delay for a user who is waiting the view the recorded video stream.
A more challenging scenario is to play the video stream 100 at an accelerated speed, such as fast forward or fast reverse. To play a digital video stream in an accelerated fast forward or fast reverse, a conventional recorder normally renders only the keyframes. All non-keyframes are skipped over. Unfortunately, for a digital video stream with limited or no keyframes, such as video stream 100, accelerated playback beginning at a selected frame in the stream is difficult because there are no nearby previous keyframes from which a complete image can be readily derived. Instead, each time the digital video recorder wants to render a selected non-keyframe, it must first decode a large number of preceding non-keyframes.
For example, to render non-keyframe 21 in stream 100 at an accelerated speed, a position pointer is placed back in the stream to enable decoding of many frames previous to the desired non-keyframe 21. In our example, the pointer may be placed as far back as non-keyframe 1 and then the non-keyframes 1-20 are decoded in a sequential forward order to yield a completely specified decoded frame for the non-keyframe 21.
This accelerated playback involves a great amount of decoding resources to render images in the fast forward or fast reverse modes of operation. In some cases, accelerated playback at a desired frame-rate may be impossible because the device playing the stream does not have sufficient resources to decode the necessary non-keyframes at the desired frame-rate. Furthermore, decoding the large number of preceding frames in order to render the necessary non-keyframes results in a noticeable time delay between displayed frames. In some cases, this time delay can be so great that it diminishes the effectiveness of a fast forward or fast reverse operation, which is supposed to be performed at a fast frame rate. At the very least, the delay can be annoying to the viewer.
FIG. 2 illustrates a conventional digital video recorder 200, which may be used to decode digital video stream 100. The digital video recorder 200 includes a source 202 that provides the compressed digital video stream 100 to a store 204, where the stream is recorded for playback at a later time.
A reader 206 retrieves individual frames of the video stream 100 from the store 204 and forwards them to a decoder 208. The video stream 100 is read from the store 204 in a manner that streams the frames sequentially to the decoder 208 as if they were being provided from the source 202 in normal real-time play. The decoder 208 decodes the frames and forwards the decoded frames to a renderer 210 for rendering and display to a user. The decoding process typically involves decompression, and hence decoders are also known as “decompressors”.
When the video recorder 200 is requested to access and decode a particular frame in the stream 100, the reader 206 retrieves the frames preceding the particular frame from the store 204 and decodes those preceding frames at the decoder 208. Initially, the decompressed video frames produced by the decoder 208 are incomplete because the first decompressed video frames also rely on data from preceding frames. The first few decompressed video frames rely on an associated state of the decoder that would have been built up in the decoder 208 had the decoder been decoding the frames in sequential order. But, by the time the decoder reaches the intended frame, the decoder state is properly built up to enable full decoding of the particular frame that results in a completely specified image. Unfortunately, this delay in playback may be disruptive to the viewer as he/she is forced to wait for the decoding of preceding frames before a renderable image is produced. Further, in accelerated playback modes, the conventional recorder 200 may not even be able to decode all of the preceding frames in time to render the particular frame at the desired frame-rate.
Accordingly, there is a need for improved decoder techniques that allow rendering of a video stream starting at a randomly accessed non-keyframe without the time delays resulting from decoding frames previous to the non-keyframe at the time of playing back the video stream.